﻿
@{ViewBag.Title = " Sugerencias "; Layout = "../Shared/_LayoutJtable.cshtml";}


<link href="~/Content/DataForm.css" rel="stylesheet" />
 
@using (Html.BeginForm(null,null, FormMethod.Post, new { @class = "box Common", @id = "myDataForm" }))
{
    <div class="header">
        Elija su destino
    </div>    
    <fieldset class="boxBody">

<div id="MyTableContainer"></div>


</fieldset>
     <footer>
         <input type="button" class="btnCancel" value ="Cancelar y Regresar" onclick="history.go(-1);"/>	    
	</footer>
}







<script type="text/javascript">
     $(document).ready(function () {
     $('#MyTableContainer').jtable({
         title: 'Sugerencias',
         paging: true,
         pageSize: 40,
         sorting: true,         
         actions: {
             listAction: '@Url.Action("JTableGetSugerenciaJson")'            
         },
         fields:
         {
             Codigo: {
                 title: 'Codigo',
                 width: '50px',
                 list: true,
                 sorting: false
             }
             ,
             Nombre: {
                 title: 'Nombre',
             list: true,                        
             sorting: false
             }
             ,
             Asignados: {
                 title: 'Asignados',
                 width: '50px',
                 list: true,
                 sorting: false
             }
             ,
             Ocupados: {
                 title: 'Ocupados',
                 width: '50px',
             list: true,                        
             sorting: false
             }
             ,
             Seleccionar:
                {
                    title: 'Acciones',
                    width: '30%',
                    sorting: false,
                    edit: false,
                    create: false,
                    display: function (tempData) {
                        var $enlace = $('<a class="item-link" href="Confirmar?guidReq=' + tempData.record.GuidRequerimiento + '">Elegir Este Destino</a>');
                        return $enlace;

                    }
                }
             
},
formCreated: function (event, data) {data.form.validationEngine();},
formSubmitting: function (event, data) {return data.form.validationEngine('validate');},
formClosed: function (event, data) { data.form.validationEngine('hide'); data.form.validationEngine('detach'); }
});

         $('#MyTableContainer').jtable('load', { filter: '' });


});
</script>




